﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model;

namespace ETWebApi2.Models
{
    public class ModelClass
    {        
    }
    //用于显示合作伙伴信息模板
    public class ShowPartner
    {
        public int Id { set; get; }
        public int CompanyId { set; get; }
        public string CompanyName { set; get; }
        public string Address { set; get; }
        public int FileNum { set; get; }
        public int State { set; get; }
        public string CanOpenUser { set; get; }
        public int Level { set; get; }
    }
    public class AddPartner
    {
        public int Id { set; get; }
        public int CompanyId { set; get; }
        public string CompanyName { set; get; }
        public string Address { set; get; }
    }
    public class PartInfo
    {
        public int Id { set; get; }
        public string Remark { set; get; }
        public string UserName { set; get; }
        //是否已经被选中 
        public bool IsChecked { set; get; }
    }
    public class Person:CUser_tb
    {
        //public string QCode { set; get; }
        public string CompanyName { set; get; }
        public Person() { }
        public Person(CUser_tb user,string companyname)
        {
            this.Id = user.Id;
            this.CompanyId = user.CompanyId;
            this.UserName = user.UserName;
            this.UserPwd = user.UserPwd;
            this.State = user.State;
            this.Role = user.Role;
            this.Permission = user.Permission;
            this.Tag = user.Tag;
            this.Time = user.Time;
            this.MAC = user.MAC ;
            this.Phone = user.Phone;
            this.Remark = user.Remark;
            this.FWH = user.FWH;
            this.ReadSM = user.ReadSM;
            this.ReadID = user.ReadID;
            this.Up = user.Up;
            this.Down = user.Down;
            this.CompanyName = companyname;
            this.Email = user.Email;
         }
    }
    //用于记录文件详细 
    public class Detail 
    {
        public string FileName { set; get; }
        public string Time { set; get; }
        public string Uploader { set; get; }
        public string CompanyName { set; get; }
        public string CanOpener { set; get; }
        public string ToUser { set; get; }
        public int DownNum { set; get; }
        public string FileSize { set; get; }
    }
    //我的上传文件 数据显示模板
    public class MyUploadShow
    {
        public int Id { set; get; }
        public string FileName { set; get; }
        public int IsValid { set; get; }
        public string CompanyName { set; get; }
        public int DownNum { set; get; }
        public string IP { set; get; }
        /// <summary>
        /// 上传时间
        /// </summary>
        public string Time { set; get; }
        /// <summary>
        /// 第一次下载时间
        /// </summary>
        public string DownloadTime { set; get; }
    }
    public class MyUploadShowBase
    {
        public Int64 rownumber { set; get; }
        public int Id { set; get; }
        public string Attachment { set; get; }
        public int IsValid { set; get; }
        public int CompanyId { set; get; }

        public string  dIP { set; get; }

        public DateTime Time { set; get; }
        /// <summary>
        /// 第一次下载时间
        /// </summary>
        public DateTime dTime { set; get; }
    }
    //公司文件 需要下载 显示模板
    public class FilesShow
    {
        public int Id { set; get; }
        //文件名
        public string FileName { set; get; }
        //公司名
        public string Name { set; get; }
        //人名
        public string UserName { set; get; }

        public string IP { set; get; }


        /// <summary>
        /// 上传时间
        /// </summary>
        public string Time { set; get; }
        /// <summary>
        /// 第一次下载时间
        /// </summary>
        public string DownloadTime { set; get; }
    }
    //匿名函数模板（需要下载中使用）
    public class NeddDownModel
    {
        public int Id { set; get; }
        //文件名
        public string FileName { set; get; }
        public int UploadId { set; get; }
        //公司Id
        public int CompanyId { set; get; }
        ////上传者姓名
        //public string UserName { set; get; }
        public DateTime Time { set; get; }
        public DateTime DTime { set; get; }   
        public int dUserId { set; get; }
        public string  dIP { set; get; }
    }
    //文件上传
    //public class UploadModel
    //{
    //    public int CompanyId { get; set; }
    //    public string CompanyName { get; set; }
    //    public int Id { get; set; }
    //    public string  UserName { get; set; }
    //    public string Remark { get; set; }
    //}
    public class UploadModel
    {
        public int CompanyId { get; set; }
        public string CompanyName { get; set; }
        public List<UploadUserModel> Users { get; set; }        
    }
    public class UploadUserModel
    {
        public int Id { get; set; }
        public string UserName { get; set; }
        public string Remark { get; set; }
    }



    //统计
    public class PRelation_tb : PartnerRelation_tb
    {
        public string Name { set; get; }
        public string Address { set; get; }
        public int filenum { set; get; }

        public PRelation_tb() { }

    }
    public class ItemList
    {
        //统计对象类目 相隔数（年/月/日）
        public int itemName { get; set; }
        //统计数目
        public int count { get; set; }
    }

    public class ItemList3 : ItemList
    {
        //对象的id
        public int who { get; set; }
    }


    public class Item
    {
        //公司名称
        public string CompanyName { get; set; }
        //数据
        public List<int> Data { get; set; }
    }

}
namespace EChart
{
    //用于生成EChart的数据 series
    public class series
    {
        //折线line,或者柱状图bar, pie
        public string name { get; set; }
        public bool show { get; set; }

        public void Clear()
        {
            xVal.Clear();
            yVal.Clear();
        }

        public int all()
        {
            int rtn = 0;
            for (int i = 0; i < yVal.Count; i++)
                rtn += yVal[i];
            return rtn;
        }
        public void Add(string x, int y)
        {
            xVal.Add(x);
            yVal.Add(y);
        }

        public List<int> yVal;
        public List<string> xVal; //用距离1970.1.1的haomiao2数表达的时间

        public series(string _name)
        {
            show = true;
            name = _name;
            yVal = new List<int>();
            xVal = new List<string>();
        }
    }


}